const koa = require('koa')
const app = new koa()
const logs = require('./koa_logs')

const { userAgent } = require('koa-useragent')
console.log(userAgent)
app.use(userAgent)


app.listen(4000)

app.use(async (ctx, next) => {
    console.log(require('util').inspect(ctx.userAgent))
})

const config = { format: text => `--------${text}---------`}

app.use(logs(config))